﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LCA.Community.DAL.Model;

namespace LCA.Community.DAL.Test.ModelFactories
{
    public class AnswersFactory
    {
        private int _count = 0;

        public AnswersFactory()
        {

        }

        public Answer CreateEntity(string question, string author)
        {
            var answer = new Answer(
                                question,
                                String.Format("This is the answer {0}", _count),
                                author
                            );
            answer.RowKey = Guid.NewGuid().ToString();

            _count++;

            return answer;
        }

        public List<Answer> CreateList (int count, string question, string author)
        {
            var answers = new List<Answer>();

            for (int i = 0; i < count; i++)
            {
                answers.Add(CreateEntity(question, author));
                ++_count;
            }

            return answers;
        }
    }
}
